package com.demo.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.demo.domain.Car;

@RestController
public class RestControllerTest {

	@RequestMapping("/hi")
	public String home(@RequestParam(value = "name") String name) {
		String s = "this is Rose second , 请求参数为:" + name;
		System.err.println(s);
		// try {
		// Thread.sleep(2000L);
		// } catch (InterruptedException e) {
		// e.printStackTrace();
		// }
		return s;
	}

	@RequestMapping("/car")
	public Car car(@RequestParam(value = "name") String name) {
		String s = "this is Rose second , 请求参数为:" + name;
		System.err.println(s);
		Car c = new Car();
		c.setName(name);
		c.setId(1001);
		return c;
	}
}
